{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}
{script src='js/pms_ajax.js'}
{$script_var}
<script type="text/javascript">
<!--
var agora_preview_url = '{url task=pms page=compose action=send format=raw}';
{literal}
function agora_preview() {
	var preview_data = {
		req_message: $$('textarea[name=req_message]').getValue(),
		req_subject: $$('input[name=req_subject]').getValue(),
		hide_smilies: $$('input[name=hide_smilies]').getValue(),
		req_username: $$('input[name=req_username]').getValue(),
		preview: 'Preview',
		form_sent: 1,
		savemessage: 1
	};

	if (!$$('input[name=hide_smilies]').getProperty('checked')) {
		preview_data.hide_smilies = 0;
	}

	new Ajax(agora_preview_url, {
			method: 'post',
			postBody: Object.toQueryString(preview_data),
			onFailure: function(){},
			onComplete: function(inResponse) {
				var box = SqueezeBox.initialize();
				box.assignOptions();
				box.setContent('string',inResponse);
			}
	}).request();

}
{/literal}
//-->
</script>
<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">##Private Messages##</span></h2>
</div>
<div class="ag_outerwrap">
	<div class="ag_pms_toolbar">
		<ul class="ag_pms_toolbar">
			<li>
				<a href="{url task=pms page=compose}">
					<img src="{$root_url}img/admin/pms-compose.png" alt="##Compose##" title="##Compose##" />
				</a>
			</li>
			<li>
				<a href="{url task=pms box=0}">
					<img src="{$root_url}img/admin/pms-inbox.png" alt="##Inbox##" title="##Inbox##" />
				</a>
			</li>
			<li>
				<a href="{url task=pms box=1}">
					<img src="{$root_url}img/admin/pms-sent.png" alt="##Sent##" title="##Sent##" />
				</a>
			</li>
		</ul>
	</div>
	<div class="ag_clearer"></div>
</div>

<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">##Send private message##</span></h2>
</div>
<div class="ag_outerwrap">
	<form id="post" method="post" name="post" action="{url task=pms page=compose action=send}">
		<fieldset class="ag_inform">
			<legend class="ag_color">##Write message legend##</legend>
			<label for="sendto" class="ag_label">
				<strong>##Send to##:</strong>
				<input id="sendto" type="text" name="req_username" value="{$recipients}" style="width:70%;" size="80" class="required subject" title="##Pleaseentertext##" tabindex="1" />
				<a onclick="resetPM2()" href="javascript:void(0);" class="pms_sender_reset">##Reset##</a>
			</label>
			<br />
			<label for="subject" class="ag_label">
				<strong>##Subject##:</strong>
				<input id="subject" class="required subject ag_text_area2" title="##Pleaseentertext##" style="width:99%;" value="{$post_subject}" type="text" name="req_subject" size="80" maxlength="70" onkeydown='textCount(document.post.subject,document.post.characterstyped_2,70);' onkeyup='textCount(document.post.subject,document.post.characterstyped_2,70);' tabindex="2" />
			</label>
			<div class="ag_characterstyped">
				<input class="ag_characterstyped" readonly="readonly" type="text" name="characterstyped_2" size="4" maxlength="4" value="70" />##characters##
			</div>
			<div class="ag_clearer"></div><br />
			{include file=agora:post/post.tpl}
		</fieldset>
		<fieldset class="ag_inform">
			<legend class="ag_color">##Options##</legend>
			<div class="ag_infldset">
				{if $agora_config.o_smilies}
				<label>
					<input type="checkbox" name="hide_smilies" value="1" />##Hide smilies##
				</label>
				<br />
				{/if}
				<label>
					<input type="checkbox" name="savemessage" value="1" checked="checked" />##Save message##
				</label>
			</div>
		</fieldset>
		<div class="ag_postbuttons">
			<span>
				<input class="ag_button ag_btn_submit" type="submit" name="submit" value="##Submit##" title="##Submit##" accesskey="s" tabindex="4" />
				<input class="ag_button ag_btn_preview" type="submit" name="preview" value="##Preview##" title="##Preview##" accesskey="p" tabindex="3" onclick="agora_preview();return false;"/>
				&nbsp;##or##&nbsp;
				<a href="javascript:void(0);" class="ag_btn_goback" title="##Go back##" onclick="javascript:history.go(-1)" tabindex="6">##Go back##</a>
			</span>
		</div>
	</form>
	{literal}
	<script type="text/javascript">
	<!--
		window.addEvent('domready', function(){
			var myFormValidation = new Validate('post',{
				errorClass: 'red',
				label: '##Please wait##'
			});
		});
		//-->
	</script>
	{/literal}
</div>